package com.secure;

public class testPGP {

	public testPGP() {

		PGP pgp = new PGP();
		pgp.generateRSAKeys();

		try {
			byte[] sym = null;
			byte[] back = null;
			for (int i = 0; i < 2; i++) {

				sym = pgp.generateAESKey();

				String s = new String(sym);
				System.out.println(s.length());

				String sym_rsa = pgp.codeRSA(sym, pgp.getN(), pgp.getE());

				System.out.println(sym_rsa);
				back = pgp.decodeRSA(sym_rsa.getBytes());

				if (back.length != 16)
					break;

			}

			System.out.println(pgp.byteToHexString(sym));
			System.out.println(pgp.byteToHexString(back));

		} catch (Exception e) {
			e.printStackTrace();
		}

	}

	public static void main(String[] args) {
		new testPGP();

	}

}
